// 引入mockjs
import Mock from "mockjs";
const arr = []


/**
"id":"@id"
"star|1-2":"★" 字符串重复一道2次
"price|100-200.2-3" 小数点2-3位
"data|10":[{name:"名称"}] 数组的内容重复10遍
"live|1":true,随机返回true,false
"tel":/13 \d{9}/,
"des":function(){ return this.start+this.price}
"name":"@cname" 表示中文名称
"address":"@country(true)" 地址
"ip":"@ip",
"description":"@cparagraph(1, 3)" 随机段落2-3行
"pic":@dataImage('200x100','色块图片')`

 */
for (let i = 0; i < 10; i++) {
  arr.push({
      id: Mock.mock("@id"),
      name: Mock.mock("@cname"),
      'age|18-60': 1,
      date: Mock.mock("@date('yyyy-MM-dd')"),
      email: Mock.mock("@email"),
      city: Mock.mock("@city(true)")
  })
}


Mock.mock('/api/getUsers', 'get', {
  status:200, //请求成功状态码
  errorCode:0,
  code:200,
  dataList:arr //模拟的请
})

  